package we3d.core.culling 
{
	/**
	* @private
	*/
	public class BoundSphere 
	{
		public function BoundSphere () {}
		
		public var bSphere:Number=0;
		public var bSphereQ:Number=0;
		
		public function set boundingSphere (v:Number) :void {
			bSphere = v;
			bSphereQ = v*v;
		}
		public function get boundingSphere () :Number {
			return bSphere;
		}
		
		public function reset () :void {
			boundingSphere = 0;
		}
		
		public function testPoint (x:Number, y:Number, z:Number) :void {
			var l:Number = x*x + y*y + z*z;
			if(l > bSphereQ) boundingSphere = Math.sqrt(l);
		}
		
		public function testPoints (pts:Array) :void {
			var L:int=pts.length;
			for(var i:int=0; i<L; i++) {
				testPoint(pts[i].x, pts[i].y, pts[i].z);
			}
		}
		
	}
	
}